package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.query.OperationUserLogQuery;
import com.novax.ex.activity.open.model.query.OperationV2ConfigQuery;
import com.novax.ex.activity.open.model.request.OperationV2ConfigRequest;
import com.novax.ex.activity.open.model.response.OperationUserLogOuterResponse;
import com.novax.ex.activity.open.model.response.OperationV2ConfigResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.validation.Valid;
import java.util.List;

/**
 * @Description 后台-活动落地页配置V2
 * @Author ChenXi
 * @Date 2023/04/18/10:48
 */
@Tag(name = "后台-活动落地页配置V2", description = "后台-活动落地页配置V2")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "OperationV2ConfigApi", contextId = "OperationV2ConfigApi")
public interface OperationV2ConfigApi {

    @Operation(summary = "分页查询")
    @GetMapping("/v3/private/operation-v2/config")
    ReturnResult<PageUtil<OperationV2ConfigResponse>> page(@ParameterObject OperationV2ConfigQuery query);

    @Operation(summary = "新增")
    @PostMapping("/v3/private/operation-v2/config/add")
    ReturnResult<?> add(@RequestHeader("language") String language,
                        @Valid @RequestBody OperationV2ConfigRequest operationConfigRequest,
                        BindingResult bindingResult);

    @Operation(summary = "修改")
    @PostMapping("/v3/private/operation-v2/config/modify/{operationId}")
    ReturnResult<?> modify(@RequestHeader("language") String language,
                           @PathVariable Long operationId,
                           @Valid @RequestBody OperationV2ConfigRequest operationConfigRequest,
                           BindingResult bindingResult);

    @Operation(summary = "删除")
    @PostMapping("/v3/private/operation-v2/config/delete/{operationId}")
    ReturnResult<?> remove(@RequestHeader("language") String language,
                           @PathVariable Long operationId);

    @Operation(summary = "查询所有参与日志")
    @GetMapping("/v3/private/operation-v2/user/log/query")
    ReturnResult<List<OperationUserLogOuterResponse>> queryList(@RequestParam Long id);

}
